#!/bin/bash
source /etc/profile
. $BEETLE_SHELL_PATH/error.sh

path=$1
# 分支名
branch=$2

cd ${path} || error_exit

if [ ${branch} ]
then
	echo "checkout branch ${branch}"
	git pull || error_exit
	git checkout ${branch} || error_exit
fi

branch=`git branch |grep "*"`
echo "start pull ${branch}"
sleep 1
git reset --hard || error_exit
git pull || error_exit
echo "pull ${branch} end"
sleep 1 
